package com.zh.po;

import com.fasterxml.jackson.annotation.JsonFormat;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;

@Table(name = "product_order")
public class Order {
    @Id
    @Column(name = "order_id")
    private Integer orderId;

    @Column(name = "order_address")
    private String orderAddress;

    @Column(name = "order_user")
    private Integer orderUser;

    @Column(name = "order_product")
    private Integer orderProduct;

    /**
     * 购买数量
     */
    @Column(name = "order_product_num")
    private Integer orderProductNum;

    /**
     * 商品总价格
     */
    @Column(name = "order_price")
    private Double orderPrice;
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Column(name = "order_date")
    private Date orderDate;

    @Column(name = "order_state")
    private Integer orderState;

    private User user;
    private Product product;
    private OrderState oState;

    public Order() {
    }

    public Order(Integer orderUser, Integer orderProduct, Integer orderProductNum, Double orderPrice, String orderAddress, Date orderDate, Integer orderState) {
        this.orderAddress = orderAddress;
        this.orderUser = orderUser;
        this.orderProduct = orderProduct;
        this.orderProductNum = orderProductNum;
        this.orderPrice = orderPrice;
        this.orderDate = orderDate;
        this.orderState = orderState;
    }

    public String getOrderAddress() {
        return orderAddress;
    }

    public void setOrderAddress(String orderAddress) {
        this.orderAddress = orderAddress;
    }

    public OrderState getoState() {
        return oState;
    }

    public void setoState(OrderState oState) {
        this.oState = oState;
    }

    public Product getProduct() {
        return product;
    }

    public void setProduct(Product product) {
        this.product = product;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    /**
     * @return order_id
     */
    public Integer getOrderId() {
        return orderId;
    }

    /**
     * @param orderId
     */
    public void setOrderId(Integer orderId) {
        this.orderId = orderId;
    }

    /**
     * @return order_user
     */
    public Integer getOrderUser() {
        return orderUser;
    }

    /**
     * @param orderUser
     */
    public void setOrderUser(Integer orderUser) {
        this.orderUser = orderUser;
    }

    /**
     * @return order_product
     */
    public Integer getOrderProduct() {
        return orderProduct;
    }

    /**
     * @param orderProduct
     */
    public void setOrderProduct(Integer orderProduct) {
        this.orderProduct = orderProduct;
    }

    /**
     * 获取购买数量
     *
     * @return order_product_num - 购买数量
     */
    public Integer getOrderProductNum() {
        return orderProductNum;
    }

    /**
     * 设置购买数量
     *
     * @param orderProductNum 购买数量
     */
    public void setOrderProductNum(Integer orderProductNum) {
        this.orderProductNum = orderProductNum;
    }

    /**
     * 获取商品总价格
     *
     * @return order_price - 商品总价格
     */
    public Double getOrderPrice() {
        return orderPrice;
    }

    /**
     * 设置商品总价格
     *
     * @param orderPrice 商品总价格
     */
    public void setOrderPrice(Double orderPrice) {
        this.orderPrice = orderPrice;
    }

    /**
     * @return order_date
     */
    public Date getOrderDate() {
        return orderDate;
    }

    /**
     * @param orderDate
     */
    public void setOrderDate(Date orderDate) {
        this.orderDate = orderDate;
    }

    /**
     * @return order_state
     */
    public Integer getOrderState() {
        return orderState;
    }

    /**
     * @param orderState
     */
    public void setOrderState(Integer orderState) {
        this.orderState = orderState;
    }
}
